FirstIndexOf Generic Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Finds the index of the first item in a list equal to a given item. A passed IEqualityComparer is used to determine equality.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public static int FirstIndexOf<T>(
	IList<T> list,
	T item,
	IEqualityComparer<T> equalityComparer
)
Visual Basic (Declaration)
Public Shared Function FirstIndexOf(Of T) ( _
	list As IList(Of T), _
	item As T, _
	equalityComparer As IEqualityComparer(Of T) _
) As Integer
Visual C++
public:
generic<typename T>
static int FirstIndexOf (
	IList<T>^ list, 
	T item, 
	IEqualityComparer<T>^ equalityComparer
)

Parameters

list
IList<(Of <T>)>
The list to search.
item
T
The item to search for.
equalityComparer
IEqualityComparer<(Of <T>)>
The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called.

Return Value

The index of the first item equal to item. -1 if no such item exists in the list.

Type Parameters

T

See Also